import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace TechnicianCommissionExtApi {
  /** 技师提成扩展信息 */
  export interface TechnicianCommissionExt {
    id: number; // 主键ID
    commissionRecordId?: number; // 提成记录ID
    technicianId?: number; // 技师ID
    serviceId?: number; // 服务ID
    roomId: number; // 房间ID
    roomNumber: string; // 房间号
    serviceDuration: number; // 服务时长(分钟)
    customerId: number; // 客户ID
    customerName: string; // 客户姓名
    qualityScore: number; // 质量评分
    customerFeedback: string; // 客户反馈
  }
}

/** 查询技师提成扩展分页 */
export function getTechnicianCommissionExtPage(params: PageParam) {
  return requestClient.get<
    PageResult<TechnicianCommissionExtApi.TechnicianCommissionExt>
  >('/spa/technician-commission-ext/page', { params });
}

/** 查询技师提成扩展详情 */
export function getTechnicianCommissionExt(id: number) {
  return requestClient.get<TechnicianCommissionExtApi.TechnicianCommissionExt>(
    `/spa/technician-commission-ext/get?id=${id}`,
  );
}

/** 新增技师提成扩展 */
export function createTechnicianCommissionExt(
  data: TechnicianCommissionExtApi.TechnicianCommissionExt,
) {
  return requestClient.post('/spa/technician-commission-ext/create', data);
}

/** 修改技师提成扩展 */
export function updateTechnicianCommissionExt(
  data: TechnicianCommissionExtApi.TechnicianCommissionExt,
) {
  return requestClient.put('/spa/technician-commission-ext/update', data);
}

/** 删除技师提成扩展 */
export function deleteTechnicianCommissionExt(id: number) {
  return requestClient.delete(`/spa/technician-commission-ext/delete?id=${id}`);
}

/** 导出技师提成扩展 */
export function exportTechnicianCommissionExt(params: any) {
  return requestClient.download('/spa/technician-commission-ext/export-excel', {
    params,
  });
}
